package cn.gailvlun.gll.presentation.hotel.night

import android.content.Context
import cn.gailvlun.gll.R
import cn.gailvlun.gll.net.hotel.InsomniaComment
import com.github.markzhai.recyclerview.SingleTypeAdapter


class HotelCommentAdapter : SingleTypeAdapter<InsomniaComment> {
    constructor(context: Context?) : super(context, R.layout.item_hotel_comment)

    fun getLastId() = mCollection.last().id

    fun removeComment(comment: InsomniaComment) {
        mCollection.indexOf(comment).takeIf { it >= 0 }?.apply {
            mCollection.removeAt(this)
            notifyItemRemoved(this)
        }
    }
}